If you want to pause command processing in a particular channel, you can use either of two sound commands, waitCmd or pauseCmd .
If you have started a sound playing by using the SndStartFilePlay function, then you can pause and resume play by using the SndPauseFilePlay function. See "Managing an Asynchronous Play From Disk" for more details.
The waitCmd command suspends all processing in a channel for a specified number of half-milliseconds. Here's an example:
mySndCmd.cmd := waitCmd; {the command is waitCmd}
mySndCmd.param1 := 2000; {1-second wait duration}
mySndCmd.param2 := 0; {unused}
{pause the channel}
myErr := SndDoImmediate(mySndChan, mySndCmd, FALSE);
To pause the processing of commands in a sound channel for an unspecified duration, use the pauseCmd command. Unlike waitCmd , pauseCmd suspends processing for an undetermined amount of time. Processing does not resume until the Sound Manager receives a resumeCmd command for the specified channel.
To issue waitCmd or pauseCmd , you can use either SndDoImmediate or SndDoCommand , depending on whether you want the suspension of sound channel processing to begin immediately or when the Sound Manager reaches that command in the normal course of reading commands from a sound channel. The resumeCmd command, which is simply the opposite of pauseCmd , should be issued by using SndDoImmediate . Neither waitCmd nor pauseCmd stops any sound that is currently playing; these commands simply stop further processing of commands queued in the sound channel.
If no other commands are pending in the sound channel after a resumeCmd command, the Sound Manager sends an emptyCmd command. The emptyCmd command is sent only by the Sound Manager and should not be issued by your application.
| Previous | Chapter contents | Chapter top | Section top | Next |